import request from '@/utils/request'
const getRolesAPI = data => {
  return request({
    url: '/sys/role',
    method: 'GET',
    params: data
  })
}
const delRolesAPI = id => {
  return request({
    url: '/sys/role/' + id,
    method: 'DELETE'
  })
}
const addRoleAPI = data => {
  return request({
    url: '/sys/role',
    method: 'POST',
    data
  })
}
const changeRoleAPI = data => {
  return request({
    url: `/sys/role/${data.id}`,
    method: 'PuT',
    data
  })
}
const getRoleDetailAPI = id => {
  return request({
    url: `/sys/role/${id}`
  })
}
const assignPermAPI = data => {
  return request({
    url: '/sys/role/assignPrem',
    method: 'put',
    data
  })
}
export { getRolesAPI, delRolesAPI, addRoleAPI, changeRoleAPI, getRoleDetailAPI, assignPermAPI }
